<template>
  <div></div>
</template>
<script>
export default {
  data() {
    return {};
  },
  activated() {
    this.redirectTo();
  },
  methods: {
    redirectTo() {
      console.log(this.isInWechatMp())
      if(this.isInWechatMp()){
        // web-view
        wx.miniProgram.reLaunch({
          url: `/packageG/index/index`
        });
      }else{
        // H5
        this.$router.push(this.fun.getUrl("home", {}));
      }
    },
    isInWechatMp() {
      return navigator.userAgent.match(/miniprogram/i) || window._wxjs_environment === "miniprogram";
    }
  }
};
</script>
<style lang="scss" scoped></style>
